// https : // iai.sh.cn/problem/238
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t = "";
  cin >> s;
  bool h = true;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '2' || s[i] == '3' || s[i] == '5' || s[i] == '7' ||
        s[i] == '4') {
      cout << "Not a strobogrammatic number";
      return 0;
    }
    if (s[i] == '9')
      t = t + '6';
    else if (s[i] == '6')
      t = t + '9';
    else
      t = t + s[i];
  }
  if (t == s)
    cout << "Strobogrammatic number";
  else
    cout << "Not a strobogrammatic number";
  return 0;
}